﻿using MetaProperties.Collections;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Collections.Generic;
using System.Collections;

namespace MetaProperties.Collections.Tests
{
    using System;


    /// <summary>
    ///This is a test class for EmptyObservableListTest and is intended
    ///to contain all EmptyObservableListTest Unit Tests
    ///</summary>
    [TestClass()]
    public class EmptyObservableListTest
    {
        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        
        /// <summary>
        ///A test for Item
        ///</summary>
        public void ItemGetTestHelper<T>()
        {
            EmptyObservableList<T> target = new EmptyObservableList<T>();
            T actual = target[0];
        }

        [TestMethod()]
        [ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void ItemGetTest()
        {
            ItemGetTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for Item
        ///</summary>
        public void ItemSetTestHelper<T>()
        {
            EmptyObservableList<T> target = new EmptyObservableList<T>();
            target[0] = default(T);
        }

        [TestMethod()]
        [ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void ItemSetTest()
        {
            ItemSetTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for IsReadOnly
        ///</summary>
        public void IsReadOnlyTestHelper<T>()
        {
            EmptyObservableList<T> target = new EmptyObservableList<T>();
            Assert.IsTrue(target.IsReadOnly);
        }

        [TestMethod()]
        public void IsReadOnlyTest()
        {
            IsReadOnlyTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for Count
        ///</summary>
        public void CountTestHelper<T>()
        {
            EmptyObservableList<T> target = new EmptyObservableList<T>();
            Assert.AreEqual(0, target.Count);
        }

        [TestMethod()]
        public void CountTest()
        {
            CountTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for System.Collections.IEnumerable.GetEnumerator
        ///</summary>
        public void GetEnumeratorTest1Helper<T>()
        {
            IEnumerable target = new EmptyObservableList<T>();
            IEnumerator actual;
            actual = target.GetEnumerator();
            Assert.IsNotNull(actual);
            Assert.AreEqual(false, actual.MoveNext());
        }

        [TestMethod()]
        [DeploymentItem("MetaProperties.Core.dll")]
        public void GetEnumeratorTest1()
        {
            GetEnumeratorTest1Helper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for RemoveAt
        ///</summary>
        public void RemoveAtTestHelper<T>()
        {
            EmptyObservableList<T> target = new EmptyObservableList<T>();
            target.RemoveAt(0);
        }

        [TestMethod()]
        [ExpectedException(typeof(InvalidOperationException))]
        public void RemoveAtTest()
        {
            RemoveAtTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for Remove
        ///</summary>
        public void RemoveTestHelper<T>()
        {
            EmptyObservableList<T> target = new EmptyObservableList<T>();
            T item = default(T);
            target.Remove(item);
        }

        [TestMethod()]
        [ExpectedException(typeof(InvalidOperationException))]
        public void RemoveTest()
        {
            RemoveTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for Insert
        ///</summary>
        public void InsertTestHelper<T>()
        {
            EmptyObservableList<T> target = new EmptyObservableList<T>();
            int index = 0;
            T item = default(T);
            target.Insert(index, item);
        }

        [TestMethod()]
        [ExpectedException(typeof(InvalidOperationException))]
        public void InsertTest()
        {
            InsertTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for IndexOf
        ///</summary>
        public void IndexOfTestHelper<T>()
        {
            EmptyObservableList<T> target = new EmptyObservableList<T>();
            T item = default(T);
            int expected = -1;
            int actual;
            actual = target.IndexOf(item);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void IndexOfTest()
        {
            IndexOfTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for GetEnumerator
        ///</summary>
        public void GetEnumeratorTestHelper<T>()
        {
            EmptyObservableList<T> target = new EmptyObservableList<T>();
            IEnumerator<T> actual;
            actual = target.GetEnumerator();
            Assert.IsNotNull(actual);
            Assert.AreEqual(false, actual.MoveNext());
        }

        [TestMethod()]
        public void GetEnumeratorTest()
        {
            GetEnumeratorTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for CopyTo
        ///</summary>
        public void CopyToTestHelper<T>()
        {
            EmptyObservableList<T> target = new EmptyObservableList<T>();
            T[] array = null;
            int arrayIndex = 0;
            target.CopyTo(array, arrayIndex);
        }

        [TestMethod()]
        public void CopyToTest()
        {
            CopyToTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for Contains
        ///</summary>
        public void ContainsTestHelper<T>()
        {
            EmptyObservableList<T> target = new EmptyObservableList<T>();
            T item = default(T);
            bool actual;
            actual = target.Contains(item);
            Assert.IsFalse(actual);
        }

        [TestMethod()]
        public void ContainsTest()
        {
            ContainsTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for Clear
        ///</summary>
        public void ClearTestHelper<T>()
        {
            EmptyObservableList<T> target = new EmptyObservableList<T>();
            target.Clear();
        }

        [TestMethod()]
        [ExpectedException(typeof(InvalidOperationException))]
        public void ClearTest()
        {
            ClearTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for Add
        ///</summary>
        public void AddTestHelper<T>()
        {
            EmptyObservableList<T> target = new EmptyObservableList<T>();
            T item = default(T);
            target.Add(item);
        }

        [TestMethod()]
        [ExpectedException(typeof(InvalidOperationException))]
        public void AddTest()
        {
            AddTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for EmptyObservableList`1 Constructor
        ///</summary>
        public void EmptyObservableListConstructorTestHelper<T>()
        {
            EmptyObservableList<T> target = new EmptyObservableList<T>();
            Assert.AreEqual(0, target.Count);
        }

        [TestMethod()]
        public void EmptyObservableListConstructorTest()
        {
            EmptyObservableListConstructorTestHelper<GenericParameterHelper>();
        }
    }
}
